import java.util.*;

public class Demo4 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
//        int n = scan.nextInt();
//        Integer[] arr = new Integer[n];
//        HashMap<Integer, List<Integer>> map = new HashMap<>();
//
//        for (int i = 0; i < n; i++) {
//            arr[i] = scan.nextInt();
//            List<Integer> list = map.getOrDefault(arr[i], new ArrayList<>());
//            list.add(i);
//            map.put(arr[i], list);
//        }
//
//        Arrays.sort(arr, (a, b) -> {
//            return b - a;
//        });

        int n = scan.nextInt();
        Integer[] arr1 = new Integer[n];//原数组
        Integer[] arr2 = new Integer[n];//排序后的数组

        for (int i = 0; i < n; i++) {
            arr1[i] = scan.nextInt();
            arr2[i] = arr1[i];
        }

        //将arr2降序排序
        Arrays.sort(arr2, (a, b) -> {
            return b - a;
        });

        System.out.println(Arrays.toString(arr2));

        //key为arr1中元素，value为需要多做对的题目
        HashMap<Integer, Integer> map = new HashMap<>();

        int index = n / 2 + n % 2;
        int left = index - 1;
        for (int i = 0; i < index; i++) {
            map.put(arr2[i], 0);
        }

        while (arr2[index - 1] == arr2[index]) {
            map.put(arr2[index], 0);
            index++;
        }

        while (arr2[left - 1] == arr2[left]) {
            map.put(arr2[index], 0);
            left--;
        }

        while (index < n) {
//            int sub = arr2[(index - (n - index - 1)) / 2 + (n - 1) % 2] - arr2[index] + 1;
            int sub = arr2[left] - arr2[index] + 1;
            if (map.getOrDefault(arr2, 0) > 0) {
                index++;
            } else {
                map.put(arr2[index], sub);
                index++;
//                left--;
            }
        }

        for (int i = 0; i < n; i++) {
            int sub = map.get(arr1[i]);
            System.out.print(sub + " ");
        }

        scan.close();
    }
}
